package com.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sfzy.entity.Fm;
import com.sfzy.mapper.FmMapper;
import com.sfzy.service.FmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName FmSeviceImpl
 * @Description TODO
 * @Author niejiacan
 * @Date 2025年08月14日 11:12
 * @Version 1.0
 */
@Service
public class FmSeviceImpl implements FmService {
    @Autowired
    private FmMapper fmMapper;


    @Override
    public int addFm(Fm fm) {
        return fmMapper.addFm(fm);
    }

    @Override
    public int updateFm(Fm fm) {
        return fmMapper.updateFm(fm);
    }

    @Override
    public int deleteFm(int id) {
        return fmMapper.deleteFm(id);
    }

    @Override
    public Fm selectFm(int id) {
        return fmMapper.selectFm(id);
    }

    @Override
    public PageInfo<Fm> pageName(Fm fm, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Fm> fms = fmMapper.pageName(fm);
        PageInfo<Fm> info =  new PageInfo<>(fms);
        return info;
    }
}
